//
//  TopicTableViewCell.m
//  lisure0.1
//
//  Created by xalo on 16/4/21.
//  Copyright © 2016年 Mr.wangYongxu. All rights reserved.
//

#import "TopicTableViewCell.h"
#import "authOrUsrModel.h"
#import "CounterListModel.h"
#import "TopicModel.h"


@implementation TopicTableViewCell

-(void)setCellWithModel:(TopicModel *)model{

    [self layoutIfNeeded];
    CGFloat radius = self.iconView.frame.size.width/2;
    [[self.iconView layer] setMasksToBounds:YES];
    [[self.iconView layer] setCornerRadius:radius];
//    NSLog(@"%.2f",radius);
    self.commentLable.text = [NSString stringWithFormat:@"%ld人参与",model.counterListModel.comment];
    self.titleLable.text = model.title;
    [self.coverimgView sd_setImageWithURL:[NSURL URLWithString:model.coverimg] placeholderImage:[UIImage imageNamed:@"IconHome"]];
    self.contentLable.text = model.content;
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:model.userinfoModel.icon] placeholderImage:[UIImage imageNamed:@"IconHome"]];
    self.unameLable.text = model.userinfoModel.uname;
    self.viewLable.text = [NSString stringWithFormat:@"%ld",model.counterListModel.view];
    self.likeLable.text = [NSString stringWithFormat:@"%ld",model.counterListModel.like];

}

- (void)awakeFromNib {
    // Initialization code
//    [self layoutIfNeeded];
//    CGFloat radius = self.iconView.frame.size.width/2;
//    NSLog(@"-------%.2f",radius);

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
